/* ========================================
   SELECTY
   ======================================== */
/* Select box styling */
.select-box {
    position: relative;
}

.select-box select {
    display: flex;
    align-items: center;
    width: 100%;
    height: 55px;
    padding: 0px 45px 0px 20px;
    border: 2px solid #a8a8a8;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    color: var(--CiemnySzaryTekst);
    background-color: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-box select option {
    padding: 12px;
    background: var(--Platonic);
    color: var(--CiemnySzaryTekst);
}

.select-box select option:disabled {
    color: #a8a8a8;
}

/* Select arrow icon */
.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    z-index: 2;
}

/* Floating label animation for select */
.select-box select:focus ~ label,
.select-box select.filled ~ label,
.select-box select:valid:not([value=""]) ~ label {
    top: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--Niebieski);
    background-color: #f5f5f5;
    padding: 0 5px;
}

/* Border hidden when focus or filled */
.select-box select:focus,
.select-box select.filled,
.select-box select:valid:not([value=""]) {
    font-size: 1.05rem;
    font-weight: 500;
    border-color: transparent;
}

/* Gradient border effect for select */
.select-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(90deg, var(--Niebieski), var(--AkcentFioletowyKoniec));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;

    /* Wersja standardowa (Firefox i przyszłe wersje innych przeglądarek) */
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

/* Show gradient border on focus or when filled */
.select-box:has(select:focus)::before,
.select-box:has(select.filled)::before,
.select-box:has(select:valid:not([value=""]))::before {
    opacity: 1;
}

/* Arrow color change on focus/filled */
.select-box select:focus ~ .select-arrow,
.select-box select.filled ~ .select-arrow,
.select-box select:valid:not([value=""]) ~ .select-arrow {
    color: var(--AkcentFioletowyKoniec);
    transform: translateY(-50%) rotate(180deg);
}

/* Disabled select styling */
.select-box select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.select-box select:disabled ~ label {
    color: #999;
}

.select-box select:disabled ~ .select-arrow {
    color: #999;
}

/* Firefox select arrow fix */
@-moz-document url-prefix() {
    .select-box select {
        padding-right: 45px;
    }
}

.options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--Platonic);
    border: 2px solid var(--Niebieski);
    border-radius: 0 0 12px 12px;
    margin-top: -2px;
    z-index: 10;
    
    /* TO ROZWIĄZUJE TWÓJ PROBLEM: */
    max-height: 200px; /* Tutaj ustawiasz, jak wysokie ma być okno */
    overflow-y: auto;  /* To dodaje scrollbar */
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Styl scrollbara (opcjonalne, dla lepszego wyglądu) */
.options-list::-webkit-scrollbar {
    width: 8px;
}
.options-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Pokazywanie listy po kliknięciu */
.select-box.active .options-list {
    opacity: 1;
    visibility: visible;
}

.option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.option:hover {
    background: #f0f0f0;
}

/* Poprawka dla Twojego labela, żeby wiedział kiedy jest "filled" */
.select-box.active label,
.select-box.filled label {
    top: 0;
    font-size: 0.95rem;
    color: var(--Niebieski);
    background: var(--Platonic);
    padding: 0 5px;
}

/* ========================================
   MEDIA QUERIES DLA SELECTÓW
   ======================================== */

@media (max-width: 768px) {
    .select-box select {
        height: 50px;
        font-size: 0.95rem;
        padding: 0px 45px 0px 18px;
    }
    
    .select-arrow {
        right: 15px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .select-box select {
        height: 48px;
        padding: 0px 40px 0px 18px;
        font-size: 0.9rem;
    }
    
    .select-box select:focus,
    .select-box select.filled,
    .select-box select:valid:not([value=""]) {
        font-size: 1rem;
    }
    
    .select-arrow {
        right: 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .select-box select {
        height: 46px;
        padding: 0px 38px 0px 16px;
    }
}


/* ========================================
   INPUTY
======================================== */

.input-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.input-group .small-error {
    margin-top: 6px;
    margin-bottom: 20px;
}

.input-box-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.input-box-wrapper .input-box {
    margin-bottom: 6px;
}

.input-box-wrapper .small-error {
    margin-top: 0;
    margin-bottom: 0;
}

.input-box {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}

.input-box input {
    width: 100%;
    height: 55px;
    padding: 0px 20px;
    border: 2px solid #a8a8a8;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    color: var(--CiemnySzaryTekst);
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.input-box label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--CiemnySzaryTekst);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0;
}

/* Floating label animation */
.input-box input:focus ~ label,
.input-box input:valid ~ label {
    top: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--Niebieski);
    background: #f5f5f5;
    padding: 0 5px;
}

/* Border hidden when focus or valid */
.input-box input:focus,
.input-box input:valid {
    font-size: 1.05rem;
    font-weight: 500;
    border-color: transparent;
}

/* Gradient border effect */
.input-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(90deg, var(--Niebieski), var(--AkcentFioletowyKoniec));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;

    /* Wersja standardowa (Firefox i przyszłe wersje innych przeglądarek) */
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

/* Show gradient border on both focus AND valid */
.input-box:has(input:focus)::before,
.input-box:has(input:valid)::before {
    opacity: 1;
}

/* Password box with icon */
.password-box {
    position: relative;
}

.password-box input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    cursor: pointer;
    z-index: 3;
    transition: color 0.3s;
}

.input-box input:focus ~ .toggle-password,
.input-box input:valid ~ .toggle-password {
    color: var(--AkcentFioletowyKoniec);
}

/* Autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 600000s 0s, color 600000s 0s;
}

/* Checkbox styling */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
    margin-top: 10px;
    margin-bottom: 30px;
}

.checkbox-container input {
    display: none;
}

.checkmark-box {
    height: 22px;
    width: 22px;
    border: 2px solid #a8a8a8;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-container input:checked ~ .checkmark-box {
    background-color: var(--Niebieski);
    border-color: var(--Niebieski);
}

.checkmark-box::after {
    content: "";
    display: none;
    width: 6px;
    height: 10px;
    border: solid var(--Platonic);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.checkbox-container input:checked ~ .checkmark-box::after {
    display: block;
}

.label-text a {
    color: var(--Niebieski);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.label-text a:hover {
    color: var(--AkcentFioletowyKoniec);
}

.checkbox-wrapper {
    margin-bottom: 30px;
}

.checkbox-wrapper .checkbox-container {
    margin-bottom: 6px;
}

.checkbox-wrapper .small-error {
    margin-top: 0;
}

/* Role selection */
.role-selection {
    margin-top: 40px;
    text-align: center;
}

.role-selection p {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--CiemnySzaryTekst);
}

.role-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.gradient-btn {
    padding: 16px 50px;
    border: none;
    border-radius: 30px;
    color: var(--Platonic);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    min-width: 160px;
    flex: 1;
    max-width: 200px;
}

.gradient-btn.submit-btn-user {
    background: #6366f1;
}

.gradient-btn.submit-btn-user:hover {
    background: #5558e3;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    scale: 1.05;
}

.gradient-btn.submit-btn-teacher {
    background: #3b82f6;
}

.gradient-btn.submit-btn-teacher:hover {
    background: #2563eb;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    scale: 1.05;
}

.gradient-btn.submit-btn-all {
    width: 100%;
    max-width: none;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%)
}

.gradient-btn.submit-btn-all:hover {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    scale: 1.05;
}

/* Error style */

.small-error {
    display: block;
    width: 100%;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 6px;
    margin-bottom: 0;
    min-height: 20px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.small-error:empty {
    display: none;
    margin-top: 0;
    min-height: 0;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.small-error:not(:empty) {
    animation: errorSlideIn 0.3s ease;
}

/* ========================================
   MEDIA QUERIES - INPUTS
======================================== */

/* Tablet - średnie (do 1024px) */
@media (max-width: 1024px) {
    .form-wrapper {
        max-width: 480px;
    }
    
    .input-box {
        margin-bottom: 25px;
    }
    
    .role-selection {
        margin-top: 30px;
    }
}

/* Tablet pionowo / Mobile poziomo (do 768px) */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
    }
    
    .input-group {
        width: 100%;
    }
    
    .input-group .small-error {
        margin-bottom: 15px;
    }
    
    .small-error {
        font-size: 0.85rem;
    }
    
    .form-wrapper {
        max-width: 100%;
    }
    
    .input-box {
        margin-bottom: 20px;
    }
    
    .input-box input {
        height: 50px;
        font-size: 0.95rem;
    }
    
    .checkbox-container {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
    
    .role-selection {
        margin-top: 25px;
    }
    
    .role-selection p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .role-buttons {
        gap: 15px;
    }
    
    .gradient-btn {
        padding: 14px 40px;
        font-size: 0.95rem;
        min-width: 140px;
    }
}

/* Mobile (do 480px) */
@media (max-width: 480px) {
    .input-box {
        margin-bottom: 18px;
    }
    
    .input-box input {
        height: 48px;
        padding: 0px 18px;
        font-size: 0.9rem;
    }
    
    .input-box label {
        font-size: 0.9rem;
        left: 18px;
    }
    
    .password-box input {
        padding-right: 45px;
    }
    
    .toggle-password {
        right: 15px;
    }
    
    .checkbox-container {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }
    
    .checkmark-box {
        height: 20px;
        width: 20px;
        margin-right: 10px;
    }
    
    .role-selection {
        margin-top: 20px;
    }
    
    .role-selection p {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .role-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .gradient-btn {
        width: 100%;
        max-width: 100%;
        padding: 14px 30px;
        font-size: 0.9rem;
    }
    
    .remember-forgot {
        margin-bottom: 30px;
    }
    
    .remember-forgot a {
        font-size: 0.9rem;
    }

    .small-error {
        font-size: 0.8rem;
        margin-top: 4px;
    }
    
    .checkbox-wrapper .small-error {
        margin-left: 30px;
    }
}

/* Bardzo małe ekrany (do 360px) */
@media (max-width: 360px) { 
    .input-box input {
        height: 46px;
        padding: 0px 16px;
    }
    
    .gradient-btn {
        padding: 12px 25px;
        font-size: 0.85rem;
    }
}

/* ====================================
Dodatkowe kolumny w formularzu
==================================== */
.normal-form {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.form-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.form-full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-columns {
        grid-template-columns: 1fr;
    }
    
    .form-full-width {
        grid-column: 1;
    }
}